home *** CD-ROM | disk | FTP | other *** search
- Path: news.dfn.de!si-nic!usenet
- From: Markus Becker <becker@zess.uni-siegen.de>
- Newsgroups: comp.lang.c
- Subject: Re: *-* Help Array 640x480 *-*
- Date: Thu, 08 Feb 1996 11:30:13 +0100
- Organization: ZESS, Uni-GH-Siegen
- Message-ID: <3119D0B5.7727@zess.uni-siegen.de>
- References: <4fb7ft$cqa@acmez.gatech.edu>
- NNTP-Posting-Host: becker.zess.uni-siegen.de
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0GoldB1 (Win95; I)
-
- Israel Denis Jr. wrote:
-
- > me create arrays that are this big. I have seen several
- > of the previous post on topics relating to arrays and
- > none have answered the question of how to declare an
- > array of 640x480 of unsigned char. i
- >
- > I know that this could be implemented with pointers
- > but I need to do this specifically with an array.
-
- Ok, I'll try it:
-
- 1) declate an array of pointers to char:
-
- char *Pixarray[640];
-
- 2) for each entry in *Pixarray allocate a coloumn of chars
-
- Pixarray[i] = (char*)malloc(sizof(char)*480);
-
- 3) then you can access it the following way:
-
- Pixarray[x][y] = ObtainPixel(x,y);
-
- Hope it works and has helped you.
-
- Markus
-
- --
- Markus Becker
- http://www.zess.uni-siegen.de/private/becker/
- Zentrum fuer Sensorsysteme (ZESS)
- http://www.zess.uni-siegen.de/private/becker/win95
-